package character;

import utilities.WorldDate;
import utilities.WorldState;

/**
 * Pregnancy class.
 * @author pcdejager
 */
public final class Pregnancy {
    /**
     * Constructor.
     * @param f The father and mother
     * @param conceive The conceive date
     * @param period The period before birth
     */
    public Pregnancy(
            final Family f,
            final WorldDate conceive,
            final int period) {
        days = period;
        conceiveDate = conceive;
        family = f;
    }
    /**
     * Is the character in labor.
     * @return True if in labor, else false
     */
    public boolean isInLabor() {
        int period = WorldDate.calculateDays(
                conceiveDate,
                WorldState.getState().now());
        if (days < period) {
            return true;
        }
        return false;
    }
    /**
     * Get the family.
     * @return The family
     */
    public Family getFamily() {
        return family;
    }
    /**
     * The conceive date.
     */
    private final WorldDate conceiveDate;
    /**
     * The days before birth.
     */
    private final int days;
    /**
     * The family.
     */
    private final Family family;
}
